package top.kaoshanji.p2ch23a;

/**
 * author kaoshanji
 * ^_^
 * create time 2025/3/2 18:15
 */
public class TraceStaticProxy implements IService {

    private IService realService;

    public TraceStaticProxy(IService realService) {
        this.realService = realService;
    }

    @Override
    public void sayHello() {
        System.out.println("entering sayHello");

        // 实际对象的调用
        this.realService.sayHello();

        System.out.println("leaving sayHello");
    }
}
